package com.top.ruizhong.main.order

import android.app.Activity
import android.content.Intent
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.module.lemlin.base.BaseAbstractActivity
import com.top.ruizhong.R
import kotlinx.android.synthetic.main.activity_order_fill.*

class OrderFillActivity : BaseAbstractActivity() {

    companion object {
        fun open(activity: Activity) {
            val intent = Intent(activity, OrderFillActivity::class.java)
            activity.startActivity(intent)
        }
    }

    private val goodsAdapter =
        object : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_goods_order) {
            override fun convert(holder: BaseViewHolder, item: String) {

            }
        }

    override val layoutResId: Int
        get() = R.layout.activity_order_fill

    override fun stateBar(): StatusBar {
        return StatusBar(isLightMode = false, view = frameOrderFillBar)
    }

    override fun initView() {
        ivOrderFillBack.setOnClickListener { this.finish() }

        rvOrderFillBody.adapter = goodsAdapter

        tvOrderFillConfirm.setOnClickListener {
            OrderPayActivity.open(activity = this)
        }
    }

    override fun initData() {
        val goods: MutableList<String> = mutableListOf()
        for (index in 0..1) {
            goods.add(index.toString())
        }
        goodsAdapter.setNewInstance(goods)
    }
}